MESSAGE("############# cef_render #############")

SET(TARGET_NAME render)

PROJECT(${TARGET_NAME} DESCRIPTION "NetEase IM Demo CEF Render Process")

SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_SOURCE_DIR}/bin")
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_SOURCE_DIR}/bin")

INCLUDE_DIRECTORIES(
    ${CMAKE_CURRENT_LIST_DIR}/../
    ${CMAKE_CURRENT_LIST_DIR}/../../
    ${CMAKE_CURRENT_LIST_DIR}/../cef_wrapper/
)

LINK_DIRECTORIES(
    ${CMAKE_CURRENT_LIST_DIR}/../../../lib/
)

CONFIGURE_FILE(
    ${CMAKE_CURRENT_LIST_DIR}/cef_render.rc.in
    ${CMAKE_BINARY_DIR}/cef_render.rc
)

FILE(GLOB_RECURSE CEF_RENDER_SOURCE *.cc *.h *.cpp *.c)

ADD_EXECUTABLE(${TARGET_NAME} ${CEF_RENDER_SOURCE} ${CMAKE_BINARY_DIR}/cef_render.rc)
TARGET_LINK_LIBRARIES(${TARGET_NAME}
    base
    shared
    libcef_dll_wrapper
    cef_module
    ${THIRD_PARTY_LIBS}
)
IF (CMAKE_BUILD_TYPE MATCHES "Release")
    TARGET_LINK_LIBRARIES(${TARGET_NAME} nim_libcef)
ELSE ()
    TARGET_LINK_LIBRARIES(${TARGET_NAME} nim_libcef_d)
ENDIF ()

SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES
    FOLDER ${GROUP_UI_COMPONENTS}
    LINK_FLAGS "/SUBSYSTEM:WINDOWS"
)

INSTALL(FILES $<TARGET_PDB_FILE:${TARGET_NAME}> DESTINATION pdb OPTIONAL)
INSTALL(
    TARGETS ${TARGET_NAME}
    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
